Skip to content

fix: add +crt-static to Windows rustflags to eliminate vcruntime140.dll dependency#407

Merged
karthiknadig merged 1 commit intomainfrom
fix/issue-406
Apr 6, 2026
Merged

fix: add +crt-static to Windows rustflags to eliminate vcruntime140.dll dependency#407
karthiknadig merged 1 commit intomainfrom
fix/issue-406

Conversation

@karthiknadig
Copy link
Copy Markdown
Member

The Windows-specific [target.'cfg(target_os = "windows")'] rustflags sections in .cargo/config.toml.disabled were overriding the global [build].rustflags, silently dropping -Ctarget-feature=+crt-static. This caused the shipped pet.exe to dynamically link VCRUNTIME140.dll and several UCRT DLLs, breaking Python environment detection on enterprise machines without the VC++ Redistributable installed.

Changes:

  • Add -Ctarget-feature=+crt-static to both Windows target-specific rustflags sections
  • Narrow the global [build] section to cfg(target_os = \"linux\") to avoid ambiguity

Verified locally: rebuilt pet.exe with the fix — VCRUNTIME140.dll and all api-ms-win-crt-* imports are eliminated.

Fixes #406

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Performance Report (Linux) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 1ms 0ms 0%
Full Refresh 77ms 127ms 79ms -2ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 81ms 551ms 72ms 9ms
Full Refresh 164ms 30210ms 125ms 39ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Test Coverage Report (Linux)

Metric Value
Current Coverage 73.2%
Base Branch Coverage 73.2%
Delta 0% ➖

Coverage unchanged.

@karthiknadig karthiknadig marked this pull request as ready for review April 6, 2026 16:09
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Test Coverage Report (Windows)

Metric Value
Current Coverage 69.41%
Base Branch Coverage 69.41%
Delta 0% ➖

Coverage unchanged.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

Performance Report (Windows) ✅

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 9ms 13ms 11ms -2ms -18.2%
Full Refresh 151ms 397ms 185ms -34ms -18.4%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@karthiknadig karthiknadig merged commit f93254b into main Apr 6, 2026
29 of 30 checks passed
@karthiknadig karthiknadig deleted the fix/issue-406 branch April 6, 2026 16:19
karthiknadig added a commit that referenced this pull request Apr 6, 2026
…lel collisions (#408)

The `unique_temp_dir()` helper in pet-pipenv tests used
`SystemTime::now().as_nanos()` to generate temp directory names. On
Windows, `SystemTime` has ~15.6ms resolution, so parallel test threads
can get the same value — causing one test's cleanup (`remove_dir_all`)
to destroy another test's files mid-execution.

**Fix:** Replace the nanos-based name with `process_id + AtomicU64
counter`, which is guaranteed unique across parallel test threads within
the same test binary.

This was observed as a flaky
`detect_pipenv_centralized_env_without_project_file_via_naming_pattern`
failure on Windows CI (e.g., PR #407 CI run).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pet.exe depends on vcruntime140.dll

2 participants